package com.google.code.jskills.dal.entities;

// Generated 25.06.2013 17:52:09 by Hibernate Tools 3.6.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * QuestionEntity generated by hbm2java
 */
@Entity
@Table(name = "QUESTION", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = "QUESTIONTEXT"))
public class QuestionEntity implements java.io.Serializable {

	private Integer id;
	private String questiontext;
	private Set<AnswerEntity> answerEntities = new HashSet<AnswerEntity>(0);
	private Set<Test2questionEntity> test2questionEntities = new HashSet<Test2questionEntity>(
			0);

	public QuestionEntity() {
	}

	public QuestionEntity(String questiontext) {
		this.questiontext = questiontext;
	}

	public QuestionEntity(String questiontext,
			Set<AnswerEntity> answerEntities,
			Set<Test2questionEntity> test2questionEntities) {
		this.questiontext = questiontext;
		this.answerEntities = answerEntities;
		this.test2questionEntities = test2questionEntities;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "QUESTIONTEXT", unique = true, nullable = false, length = 1024)
	public String getQuestiontext() {
		return this.questiontext;
	}

	public void setQuestiontext(String questiontext) {
		this.questiontext = questiontext;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "questionEntity")
	public Set<AnswerEntity> getAnswerEntities() {
		return this.answerEntities;
	}

	public void setAnswerEntities(Set<AnswerEntity> answerEntities) {
		this.answerEntities = answerEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "questionEntity")
	public Set<Test2questionEntity> getTest2questionEntities() {
		return this.test2questionEntities;
	}

	public void setTest2questionEntities(
			Set<Test2questionEntity> test2questionEntities) {
		this.test2questionEntities = test2questionEntities;
	}

}
